<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Waterful-布局</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    #main-body {
      display: flex;
      gap: 16px;
      width: 80%;
      margin: 20px auto;
      /* border: 1px solid red; */
    }

    #main-body .item {
      flex: 1;
    }

    #main-body .item a {
      /* 溢出隐藏 */
      overflow: hidden;
      display: block;
      width: 100%;
      border-radius: 18px;
      margin-bottom: 15px;
      border: 1px solid red;
    }

    #main-body .item a .img1 {
    /* 注意：正常做项目时，插入的图片默认会有底部缝隙 */
    /* 因为浏览器行内元素排版中存在用于对齐的基线（baseline）#由上到下：顶线、中线、基线、底线 */
    /* 解决方法(一):垂直对齐:只要不是baseline都可以解决，适用场景：使图片和文字实现对齐 */
      vertical-align: middle;
    /* 解决方法(二):转化为块级元素 */
    /* display: block; */
      height: 200px;
      width: 100%;
      background-color: antiquewhite;
    }
  </style>
</head>

<body>
  <div id="main-body">
    <div class="item">
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
    </div>
    <div class="item">
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
    </div>
    <div class="item">
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
    </div>
    <div class="item">
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
        <a href="#"><div class="img1"></div></a>
    </div>
  </div>
</body>

</html>